package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
import java.util.Objects;
@Entity
public class Zdelivery {
    private int deliveryId;//交付计划id
    private Zorder orderId;//订单id
    private TfyclientForm clientId;//客户id
    private BigDecimal deliveryMoney;//产品总金额
    private Timestamp deliveryTime;//计划交付日期
    private String deliveryIssue;//交付计划期次4
    private String deliveryOwner;//交付计划所有者
    private String deliveryRemark;//交付计划备注8
    private String deliveryTheme;//交付计划主题
    private String deliveryStatic;//交付计划状态
    private List<Zdeliverydelivery> xq;

    @Id
    @Column(name = "delivery_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getDeliveryId() {
        return deliveryId;
    }

    public void setDeliveryId(int deliveryId) {
        this.deliveryId = deliveryId;
    }

    @OneToMany(mappedBy = "deliveryId")
    public List<Zdeliverydelivery> getXq() {
        return xq;
    }

    public void setXq(List<Zdeliverydelivery> xq) {
        this.xq = xq;
    }

    @ManyToOne
    @JoinColumn(name = "order_id", referencedColumnName = "order_id")
    public Zorder getOrderId() {
        return orderId;
    }

    public void setOrderId(Zorder orderId) {
        this.orderId = orderId;
    }

    @ManyToOne
    @JoinColumn(name = "client_id", referencedColumnName = "client_id")
    public TfyclientForm getClientId() {
        return clientId;
    }

    public void setClientId(TfyclientForm clientId) {
        this.clientId = clientId;
    }

    @Basic
    @Column(name = "delivery_money")
    public BigDecimal getDeliveryMoney() {
        return deliveryMoney;
    }

    public void setDeliveryMoney(BigDecimal deliveryMoney) {
        this.deliveryMoney = deliveryMoney;
    }

    @Basic
    @Column(name = "delivery_static")
    public String getDeliveryStatic() {
        return deliveryStatic;
    }

    public void setDeliveryStatic(String deliveryStatic) {
        this.deliveryStatic = deliveryStatic;
    }

    @Basic
    @Column(name = "delivery_time")
    public Timestamp getDeliveryTime() {
        return deliveryTime;
    }

    public void setDeliveryTime(Timestamp deliveryTime) {
        this.deliveryTime = deliveryTime;
    }

    @Basic
    @Column(name = "delivery_issue")
    public String getDeliveryIssue() {
        return deliveryIssue;
    }

    public void setDeliveryIssue(String deliveryIssue) {
        this.deliveryIssue = deliveryIssue;
    }

    @Basic
    @Column(name = "delivery_owner")
    public String getDeliveryOwner() {
        return deliveryOwner;
    }

    public void setDeliveryOwner(String deliveryOwner) {
        this.deliveryOwner = deliveryOwner;
    }

    @Basic
    @Column(name = "delivery_remark")
    public String getDeliveryRemark() {
        return deliveryRemark;
    }

    public void setDeliveryRemark(String deliveryRemark) {
        this.deliveryRemark = deliveryRemark;
    }

    @Basic
    @Column(name = "delivery_theme")
    public String getDeliveryTheme() {
        return deliveryTheme;
    }

    public void setDeliveryTheme(String deliveryTheme) {
        this.deliveryTheme = deliveryTheme;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Zdelivery zdelivery = (Zdelivery) o;
        return deliveryId == zdelivery.deliveryId &&
                Objects.equals(orderId, zdelivery.orderId) &&
                Objects.equals(clientId, zdelivery.clientId) &&
                Objects.equals(deliveryMoney, zdelivery.deliveryMoney) &&
                Objects.equals(deliveryTime, zdelivery.deliveryTime) &&
                Objects.equals(deliveryIssue, zdelivery.deliveryIssue) &&
                Objects.equals(deliveryOwner, zdelivery.deliveryOwner) &&
                Objects.equals(deliveryRemark, zdelivery.deliveryRemark);
    }

    @Override
    public int hashCode() {
        return Objects.hash(deliveryId, orderId, clientId, deliveryMoney, deliveryTime, deliveryIssue, deliveryOwner, deliveryRemark);
    }
}
